package com.finger.hospservice.controller;

import com.finger.hospservice.service.DepartmentService;
import com.finger.modelservice.result.Result;
import com.finger.modelservice.vo.hosp.DepartmentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
//@CrossOrigin
@RequestMapping(value = "/admin/hosp/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @GetMapping(value = "findDepartmentTree/{hoscode}")
    public Result findDepartmentTree(@PathVariable String hoscode){

        List<DepartmentVo> list =  departmentService.findDepartmentTree(hoscode);

        return Result.ok(list);
    }

}
